<?php

/**
 * TurmaAnoLetivo form base class.
 *
 * @package    form
 * @subpackage turma_ano_letivo
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseTurmaAnoLetivoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_turma_ano_letivo' => new sfWidgetFormInputHidden(),
      'nu_ano_letivo'       => new sfWidgetFormInput(),
      'periodo'             => new sfWidgetFormInput(),
      'id_turma'            => new sfWidgetFormDoctrineChoice(array('model' => 'Turma', 'add_empty' => true)),
      'idade_inicio'        => new sfWidgetFormInput(),
      'idade_fim'           => new sfWidgetFormInput(),
      'st_turma_ano_letivo' => new sfWidgetFormInput(),
      'qtde_alunos'         => new sfWidgetFormInput(),
      'created_at'          => new sfWidgetFormDateTime(),
      'updated_at'          => new sfWidgetFormDateTime(),
      'deleted'             => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id_turma_ano_letivo' => new sfValidatorDoctrineChoice(array('model' => 'TurmaAnoLetivo', 'column' => 'id_turma_ano_letivo', 'required' => false)),
      'nu_ano_letivo'       => new sfValidatorString(array('max_length' => 4)),
      'periodo'             => new sfValidatorString(array('max_length' => 1)),
      'id_turma'            => new sfValidatorDoctrineChoice(array('model' => 'Turma', 'required' => false)),
      'idade_inicio'        => new sfValidatorInteger(array('required' => false)),
      'idade_fim'           => new sfValidatorInteger(array('required' => false)),
      'st_turma_ano_letivo' => new sfValidatorString(array('max_length' => 1)),
      'qtde_alunos'         => new sfValidatorInteger(array('required' => false)),
      'created_at'          => new sfValidatorDateTime(array('required' => false)),
      'updated_at'          => new sfValidatorDateTime(array('required' => false)),
      'deleted'             => new sfValidatorBoolean(),
    ));

    $this->widgetSchema->setNameFormat('turma_ano_letivo[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'TurmaAnoLetivo';
  }

}
